<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8">
        <title>注册-MyBooks</title>
        <script language="javascript">
            function toValid(){
                var password = document.getElementsByName('password')[0].value;
                var password2 = document.getElementsByName('password2')[0].value;
                if(password != password2) {
                    alert("两次的登录密码不一致!");
                    return false;
                } else {
                    return true;
                }
            }
        </script>
    </head>
    <body>
        <header><h2>注册</h2></header>
        <form method="post" onsubmit="return toValid()">
            <label>登录名：</label><input name="username"></br>
            <label>密码：</label><input name="password" type="password"></br>
            <label>确认密码：</label><input name="password2" type="password"></br>
            <label>昵称：</label><input name="nickName"></br>
            <label>邮箱：</label><input name="email"></br>
            <input type="submit" value="提交"/>
            <input type="reset" value="重置"/>
        </form>
    </body>
</html>